/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.cobranza.dto;

import com.brain.cobranza.util.UtilCobranza;
import com.brain.core.dto.ComunDto;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 *
 * @author Hvives
 */
@Entity
@Table(name = "TCOB_PRODUCTO_EMPRESA")
public class ProductoEmpresaDto implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_TCOB_PRODUCTO_EMPRESA")
    @TableGenerator(name = "SEQ_TCOB_PRODUCTO_EMPRESA", table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "TCOB_PRODUCTO_EMPRESA", allocationSize = 1)
    private Long id;
    
    @Size(max = 20)
    @Column(name = "CODIGO")
    private String codigo;
    
    @Size(max = 200)
    @Column(name = "DESCRIPCION")
    private String descripcion;
    
    @JoinColumn(name = "EMPRESA", referencedColumnName = "ID")
    @ManyToOne
    private EmpresaCobranzaDto empresaCobranzaDto;

    public ProductoEmpresaDto() {
    }

    public ProductoEmpresaDto(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public EmpresaCobranzaDto getEmpresaCobranzaDto() {
        return empresaCobranzaDto;
    }

    public void setEmpresaCobranzaDto(EmpresaCobranzaDto empresaCobranzaDto) {
        this.empresaCobranzaDto = empresaCobranzaDto;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductoEmpresaDto)) {
            return false;
        }
        ProductoEmpresaDto other = (ProductoEmpresaDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.brain.cobranza.dto.ProductoEmpresaDto[ id=" + id + " ]";
    }
}
